<?php echo  $this->Html->script('validate'); ?>
<?php echo $this->Html->css('frontend/styles'); ?>
<?php echo $this->Html->css('frontend/contact'); ?>
<div id="wr_left">
    <?php echo $this->element('frontend/catelog'); ?>
    <?php echo $this->element('frontend/hot'); ?>
    <?php echo $this->element('frontend/new'); ?>       
    <div class="clear"></div>
</div>
<div id="wr_right">
    <div class="bg_dot">
        <div class="nav">
            <h2><a target="_self" href="#">Liên hệ</a></h2>

        </div>
    </div>
    <div class="clear"><br/> </div>
    <div class="product_listing">
        <div class="content">
            <h2 class="icon_favorite">Shop thời trang <span style="color:#9E1F63">ROY SHOP</span> </h2>
            <br/>
            <img style="float:left;height:100px" src="<?php echo $this->webroot;?>img/frontend/logo.png" alt="no_image"/>
            <br/>
            <p> <span class="title_contact">Địa chỉ:</span> K32/01 Thanh Sơn, phường Thanh Bình, quận Hải Châu, thành phố Đà Nẵng
                <br/>
                <span class="title_contact">Email:</span>  nguyenha114.dna@gmail.com
            <br/>
            <span class="title_contact">Điện thoại:</span> 0903.051.888 - 0994.968.999
            <br/>
            <span class="title_contact">Website:</span> royshop.vn
            </p>
            <br/>
        </div> 
        <div class="content">

            <h2 class="icon_phone">Liên hệ với chúng tôi</h2>
            <form action="<?php echo $this->Html->url("/Pages/contact");?>" method="POST" onSubmit="return checkSubmit()">
                <label class="contact_label">Họ và tên <span class="contact_important">*</span></label>
                <input id="fullname" class="contact_input" name="fullname" value=""/>
                <p id="errorName" class="error"></p>
                <label class="contact_label">Email<span class="contact_important">*</span></label>
                <input class="contact_input" name="email" value="" id="mail"/>
                <p id="errorMail" class="error"></p>
                <label class="contact_label" >Số điện thoại</label>
                <input class="contact_input" name="phone" value="" id="phone"/>
                <p id="errorPhone" class="error"></p>
                <label class="contact_label">Nội dung<span class="contact_important">*</span></label>
                <textarea class="contact_text" name="content" id="content"></textarea>
                <br />
                <p id="error" class="error"><?php echo (isset($message))?$message:""?></p>    
                <input type="submit" value="Gởi thông tin" class="contact_submit"/>
                <span class="contact_important">("*" các thông tin bắt buộc)</span>
            </form>
        </div>
        <div class="content">
            <h2 class="icon_map">Vị trí chúng tôi</h2>
            <iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d3833.748331910294!2d108.211866!3d16.078544300000004!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x31421847a595596f%3A0x6262bc7f657a2dc5!2s1+Thanh+Son%2C+Thanh+B%C3%ACnh%2C+Thanh+Kh%C3%AA!5e0!3m2!1svi!2s!4v1397189344072" width="100%" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe>
 
        </div>
    </div>


    <div class="clear"> </div>
</div>
<script>
    function checkSubmit()
    {
           var  validateName   = new validate("fullname","errorName","Bạn chưa nhập tên");
           var  validateMail   = new validate("mail","errorMail","Bạn chưa nhập địa chỉ email");
           var resultName = validateName.notEmpty();
           var resultMail = validateMail.notEmpty();
           var  validateContent   = new validate("content","error","Bạn chưa nhập nội dung liên hệ");
           var resultContent=validateContent.notEmpty();
           var resultPhone=true;
           if($("#phone").val() !="")
           {
                 var  validatePhone   = new validate("phone","errorPhone","Số điện thoại không đúng định dạng");
                 resultPhone=  validatePhone.isNumber();
           } 
           if(resultMail)
           { 
             validateMail.message="Email không đúng định dạng";
             resultMail = validateMail.email();
            } 
            
             return resultName && resultMail && resultContent && resultPhone;
    }
</script>



                  